home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK2.toast / Development Kits (Disc 2) / QuickTime / Programming Stuff / Documentation / develop articles / develop Issue 15 / Text To Speech media handler / Code / MyRegisterComponent.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-26  |  835 b   |  38 lines  |  [TEXT/KAHL]

  1. #include <GestaltEqu.h>
  2. #include "ComponentData.h"
  3. #include "MyRegisterComponent.h"
  4.  
  5. pascal ComponentResult MyRegisterComponent(PrivateGlobals **storage)
  6. {
  7. ComponentResult        result=-1;
  8.  
  9. result = (ComponentResult) SetDefaultComponent( (Component) (*storage)->self, 
  10.                                                             defaultComponentIdentical +
  11.                                                             defaultComponentAnyFlags );
  12.  
  13. result = CreateComponentGlobals(storage, 0);
  14.     
  15. return result;
  16. }
  17.  
  18. ComponentResult CreateComponentGlobals(PrivateGlobals **storage, Component delegateComponent)
  19. {
  20. SharedGlobals        *mySharedGlobalsPtr;
  21.  
  22. mySharedGlobalsPtr = (SharedGlobals *) NewPtrSysClear( sizeof(SharedGlobals) );
  23. if (mySharedGlobalsPtr)
  24.     {
  25.     mySharedGlobalsPtr->delegateComponent = delegateComponent;
  26.     SetComponentRefcon((Component)(*storage)->self,(long) mySharedGlobalsPtr);
  27.     }
  28. else
  29.     return -1;
  30.     
  31. return noErr;
  32. }
  33.  
  34.  
  35.  
  36.  
  37.  
  38.